package com.code.day13String;

import java.util.Scanner;

public class Test12 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String data = sc.next();
//     创建Stirngbuffer对象
        StringBuffer sb = new StringBuffer();
//       2 拼接数据
        sb.append(data);
//        3翻转
        sb.reverse();
        System.out.println(sb);
//        4将stringbuffer对象转换成string对象
        String data1 = sb.toString();
        if (data.equals(data1)) {
            System.out.println("回文");
        } else {
            System.out.println("不是回文");
        }



        String [] data2 = {"hello","world","java","javaSE"} ;
          StringBuffer sb1 = new StringBuffer();
          sb1.append("[");
        for (int i = 0; i <data2.length ; i++) {
            sb1.append(data2[i]);
            if(i != data2.length-1){
                sb1.append(",");
            }
        }
        sb1.append("]");
    System.out.println(sb1.toString());
    }
}
